package org.peoples.messages {
	
	import org.peoples.rooms.RoomPool;
	import org.peoples.users.UserPool;
	import org.peoples.rooms.RoomProperties;
	import org.peoples.users.User;
	
	public class MessageHandler implements IMessageHandler {
		
		private var rooms:RoomPool;
		private var users:UserPool;
		
		public function MessageHandler() {
			
			this.rooms = RoomPool.getInstance();
			this.users = UserPool.getInstance();
			
		}
		
		public function receiveMessage(message:Message):void {
			var room:RoomProperties = rooms.getRoom(message.room.ID);
			
			room.addMessage(message);
		}
		
	}
	
}